package com.internetCafes.spms.core.exception;

/**
 * 运行异常枚举
 */
public enum RRExceptionCodeEnum {
    SUCCESS(200, "操作成功"),
    FAIL(500, "操作失败"),
    FAIL_FILE_SAVE(500, "保存失败"),
    PARAM_ERROR(500, "参数错误"),
    PARAM_REPEAT(500, "信息重复"),
    DATA_NOT_EXIST(500, "数据不存在"),
    DATA_IS_NULL(500, "数据为空"),
    NO_AUTHORITY(500, "无权限"),
    FILE_FORMAT_ERROR(500, "文件格式错误"),

    CERTIFICATE_STATUS_NOT_VOID(500, "证书未作废，不支持删除"),

    USER_HAS_EXTEND_INFO(500, "该账号下还有关联数据，无法删除"),
    USER_MOBILE_USED(500, "手机号已被注册"),

    TENANT_CERTIFICATE_CODE_FORMAT_ERROR(500, "社会统一信用代码不正确"),

    USER_PASSWORD_EMPTY(500, "请输入密码"),

    ROLE_NAME_REPEAT(500,"角色名称已存在"),
    ROLE_HAS_USER(500, "角色已分配，无法删除"),
    ROLE_HAS_CHILDREN(500, "存在子角色，无法删除"),
    ROLE_IS_SYSTEM(500, "角色为系统默认设置，不可删除"),
    // 企业区域模块
    AREA_NAME_REPEAT(500, "区域名称重复"),
    AREA_HAS_CHILDREN(500, "改市下存在区域信息，无法删除"),
    AREA_HAS_CUSTOMER(500, "改市下存在客户，无法删除"),

    // 企业客户信息
    CUSTOMER_FOLLOW_CAN_NOT(500, "不支持编辑"),
    CUSTOMER_CODE_REPEAT(500, "信用代码重复"),
    CUSTOMER_CONFIG_SALE_ERROR(500, "销售分配失败，请联系管理员"),
    CUSTOMER_PERSON_EXIST(500, "个人客户已存在"),
    CUSTOMER_AREA_NAME_ERROR(500, "区域信息错误"),
    CUSTOMER_FOLLOW_CONTENT_LOWER(500, "跟进内容不得少于20字"),
    CUSTOMER_DEAL_CAN_NOT_TO_INTENTION(500, "成交客户不能转为意向客户"),
    CUSTOMER_IS_INTENTION(500, "已经是意向客户"),
    CUSTOMER_IS_DEAL(500, "已经是成交客户"),
    CUSTOMER_IS_OTHER_INTENTION(500, "该客户是别人的意向客户"),
    CUSTOMER_SALE_TOO_LONG(500, "分配时间超过管理时间"),
    CUSTOMER_COOPERATION_TYPE_ERROR(500, "客户合作记录类型错误"),
    CUSTOMER_DEAL_SAVE_NEED_COOPERATION_INFO(500, "成交客户新增需要成交记录"),

    DATE_FORMAT_ERROR(500, "日期格式错误"),

    ENT_DICT_VALUE_EXIST(500, "数据重复"),

    // 账号管理模块 操作异常 1100 开头异常
    USER_DELETE_FAIL_AS_HAVE_EXTEND_DATA(1101, "该账号下还有关联数据，无法删除"),

    // 角色
    ROLE_UPDATE_FAIL_CAN_NOT_UPDATE_OWN_ROLE(1201, "修改失败，无法修改自己的角色信息"),
    ROLE_UPDATE_FAIL_CAN_NOT_UPDATE_NOT_LOWER_LEVEL_ROLE(1202, "修改失败，无法修改非下级角色信息"),
    ROLE_UPDATE_FAIL_CAN_NOT_UPDATE_NO_MENU_JURIS(1203, "修改失败，没有菜单分配权限"),

    // 企业员工
    EMPLOYEE_MOBILE_IS_BLANK(501, "操作失败，员工手机号为空"),
    PRJ_MEMBER_NOT_EXIST(500, "人员信息不存在"),
    // 证书
    CERT_CERTIFICATE_OVERDUE(1605, "证书已逾期，无法操作"),
    CERT_CERTIFICATE_HAS_TO_VOID(1605, "证书已存在，请在在作废列表中删除或还原"),
    CERT_CERTIFICATE_UNABLE_DETAINEE(1606, "该证书的人员有别的证书正在借出状态，不支持押人操作"),
    CERT_CERTIFICATE_UNABLE_WARRANT(1607, "该证书已借出，不支持押证操作"),
    CERT_CERTIFICATE_UNABLE_BORROW_OUT(1608, "该证书已被押证，不支持借出"),
    CERT_CERTIFICATE_HAS_BORROW_OUT_THIS_PROJECT(1609, "该证书已在该项目中借出"),
    CERT_CERTIFICATE_NO_AFFILIATION_RECORD(1610, "证书没有挂出记录"),
    CERT_CERTIFICATE_BORROW_OUT_HAS_RETURN(1611, "证书借出已经还回"),
    CERT_CERTIFICATE_NOT_AFFILIATION_OUT(1612, "证书未挂出"),
    CERT_CERTIFICATE_NO_BORROW_OUT_RECORD(1613, "证书没有借出记录"),

    EMPLOYEE_IS_NOT_EXIT(1701, "人员已离职或者不存在"),
    ;

    /**
     * 错误编码
     */
    private int code;

    /**
     * 错误信息
     */
    private String message;

    RRExceptionCodeEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
